package com.maimao.model.user.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/11/28 11:16 上午
 */
@Setter
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("sys_user")
public class SysUser implements Serializable {
    private static final long serialVersionUID = -5713353238391241705L;
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String username;

    private String password;

    @TableField("real_name")
    private String realName;

    private String mobile;

    private String email;

    private String wx;

    @TableField("id_number")
    private String idNumber;

    /**
     * 0 已冻结 1正常 2已删除
     */
    private Integer status;

    @TableField("department_id")
    private Integer departmentId;

    /**
     * 部门层级
     */
    @TableField("department_path")
    private String departmentPath;

    /**
     * 是否为部门负责人
     */
    private Integer leader;

    private LocalDate birthday;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;

    private String picture;

    @TableField(exist = false)
    private List<Role> roleList;

    @Override
    public String toString() {
        return "SysUser{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", realName='" + realName + '\'' +
                ", mobile='" + mobile + '\'' +
                ", email='" + email + '\'' +
                ", wx='" + wx + '\'' +
                ", idNumber='" + idNumber + '\'' +
                ", status=" + status +
                ", departmentId=" + departmentId +
                ", departmentPath='" + departmentPath + '\'' +
                ", leader=" + leader +
                ", birthday=" + birthday +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", avatar='" + picture + '\'' +
                '}';
    }
}
